package entity.SCM;

import entity.RawMaterial;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class Batch implements Serializable {
    
    public enum BatchType {Product,Material}
    public enum Status {In, Out}
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private BatchType batchType;
    private Status status;
    @Temporal(value = TemporalType.DATE)
    private Date batchDate;
    @Temporal(value = TemporalType.DATE)
    private Date expiryDate;
    private Long quantity;
    private String location;
    
    @OneToOne
    private ProductBalance product;
    
    @OneToOne
    private RawMaterial material;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getBatchDate() {
        return batchDate;
    }

    public void setBatchDate(Date batchDate) {
        this.batchDate = batchDate;
    }

    public Date getExpiryDate() {
        return expiryDate;
    }

    public void setExpiryDate(Date expiryDate) {
        this.expiryDate = expiryDate;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public Long getQuantity() {
        return quantity;
    }

    public void setQuantity(Long quantity) {
        this.quantity = quantity;
    }

    public BatchType getBatchType() {
        return batchType;
    }

    public void setBatchType(BatchType batchType) {
        this.batchType = batchType;
    }

    public RawMaterial getMaterial() {
        return material;
    }

    public void setMaterial(RawMaterial material) {
        this.material = material;
    }

    public ProductBalance getProduct() {
        return product;
    }

    public void setProduct(ProductBalance product) {
        this.product = product;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

}
